define(['app'], function(app) {
	'use strict';

	var controller = function controller($scope, Addcart) {
		
		//默认的数量
		$scope.productNumber = 1;
		
		//加1
		$scope.productNumber_add = function(){
			$scope.productNumber +=1;
		}
		//减1
		$scope.productNumber_reduce = function(){
			if($scope.productNumber>1){
				$scope.productNumber -=1;
			}
		}
		
	}

	controller.$inject = ['$scope', 'Addcart'];
	
	return app.registerController("addcartctrl",controller);
});